/* ==================================================================   
 * Created [2009-4-27 下午11:32:55] by Jon.King 
 * ==================================================================  
 * TSS 
 * ================================================================== 
 * mailTo:jinpujun@hotmail.com
 * Copyright (c) Jon.King, 2009-2012 
 * ================================================================== 
*/

package com.jinhe.tss.cms.entity;

import java.io.Serializable;

import javax.persistence.Embeddable;

/** 
 * <p> ChannelArticle实体对象主键 </p>
 */
@Embeddable
public class ChannelArticleId implements Serializable {

	private static final long serialVersionUID = 418162630864743404L;
	
	private Long channelId;			//栏目编号 PK
    private Long articleId;			//文章编号 PK
    
    public ChannelArticleId(){}
    
    public ChannelArticleId(Long channelId, Long articleId){
        this.channelId = channelId;
        this.articleId = articleId;
    }
 
    public Long getArticleId() {
        return articleId;
    }
 
    public Long getChannelId() {
        return channelId;
    }
 
    public void setArticleId(Long articleId) {
        this.articleId = articleId;
    }
 
    public void setChannelId(Long channelId) {
        this.channelId = channelId;
    }

    public boolean equals(Object obj) {
        ChannelArticleId object = (ChannelArticleId)obj;
        return this.channelId.equals(object.getChannelId())
        	&& this.articleId.equals(object.getArticleId());     
    }   

    public int hashCode() {
        return (this.channelId + "_" + this.articleId).hashCode();
    } 

    public String toString() {
        StringBuffer sb = new StringBuffer();
		sb.append("channelId=").append(this.channelId).append(", articleId=").append(this.articleId);
		return sb.toString();
    }
}

